package test;

public class Test20210324 {

        public static void main(String[] args) {
            NewTwo20210324 print = new NewTwo20210324();
            String a = "1234567";
            String b = "abcdefg";
            print.setA(a);
            print.setB(b);
            print.setAIndex(0);
            print.setBIndex(0);
            new Thread(new Runnable() {
                public void run(){
                    for(int i=0;i<a.length();i++) {
                        print.printA();
                    }
                }
            }).start();

            new Thread(new Runnable() {
                public void run() {
                    for(int i=0;i<b.length();i++) {
                        print.printB();
                    }
                }
            }).start();
        }
    }